<!DOCTYPE html>
<html>

<head>
    <style type="text/css">
    .fade-enter-active,
    .fade-leave-active {
        transition: opacity .5s
    }
    
    .fade-enter,
    .fade-leave-active {
        opacity: 0
    }
    </style>
    <title>transitions简单示例</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <button v-on:click="show = !show">切换状态</button>
        <transition name="fade">
            <div v-if="show">Hello Vue.js.</div>
        </transition>
    </div>
    <script>
    new Vue({
        el: '#app',
        data: {
            show: true
        }
    })
    </script>
</body>

</html>
